flask redirect to url

39

from flask import Flask, redirect

app = Flask(__name__)

@app.route('/')
def index():
    return redirect("http://www.example.com", code=302)

if __name__ == '__main__':
    app.run()

Comments

Submit
0 Comments